import React from 'react'
import { Select,Input } from 'antd';
import {useState} from "react"
const { TextArea } = Input;
function Mycontent() {
    let [ipt,setIpt] = useState("")
    let fn = (e)=>{
        console.log(e.target.value);
        setIpt(e.target.value)
    }
    const handleChange = (value) => {
        console.log(`selected ${value}`);
      };
  return (
    <div>
        <Select
      defaultValue="lucy"
      style={{
        width: 120,
      }}
      onChange={handleChange}
      options={[
        {
          value: 'jack',
          label: 'Jack',
        },
        {
          value: 'lucy',
          label: 'Lucy',
        },
        {
          value: 'disabled',
          label: 'Disabled',
        },
        {
          value: 'Yiminghe',
          label: 'yiminghe',
        },
      ]}


      
    />


<div style={{width:"30vw"}}>
    {/* 受控组件提供value属性和onchange事件 */}
    <TextArea rows={4} placeholder="maxLength is 6" maxLength={60} value={ipt} onChange={fn}/>
    <div>{ipt}</div>
</div>


);

    </div>
  )
}

export default Mycontent